diff -ruN a/apps/Makefile b/apps/Makefile
--- a/apps/Makefile	2020-05-11 17:05:20.000000000 +0200
+++ b/apps/Makefile	2020-05-26 00:32:48.470418674 +0200
@@ -52,7 +52,7 @@
 LDSCRIPT	= $(TOPDIR)/gnuefi/elf_$(ARCH)_fbsd_efi.lds
 endif
 
-LDFLAGS		+= -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
+LDFLAGS		+= -O1 --sort-common --as-needed -z relro -z now -shared -Bsymbolic -L../lib -L../gnuefi $(CRTOBJS)
 
 LOADLIBES	+= -lefi -lgnuefi
 LOADLIBES	+= $(LIBGCC)
